package com.cf.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;

import org.springframework.beans.factory.annotation.Autowired;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.cf.utils.validator.group.AddGroup;
import com.cf.utils.validator.group.UpdateGroup;

import lombok.Data;

/**
 * 系统用户
 * 
 */

@Data
@TableName("CharlieOutsys_user")
public class SysUserEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 用户ID
	 */
	@TableId(type = IdType.AUTO)
	private Long userId;

	/**
	 * 用户名
	 */
	@NotBlank(message = "用户名不能为空", groups = { AddGroup.class,
			UpdateGroup.class })
	private String username;

	/**
	 * 用户姓名
	 */
	// @NotBlank(message = "姓名不能为空", groups = { AddGroup.class,
	// UpdateGroup.class })
	@Autowired
	private String truename;
	/**
	 * 密码
	 */
	@NotBlank(message = "密码不能为空", groups = AddGroup.class)
	private transient String password;

	private String department;
	private int flowNo;
	private String areaCode;
	private Integer power;// 3:管理员 ；2：部门长 ；1：普通员工 ；0：失效
	/**
	 * 邮箱
	 */
	@NotBlank(message = "邮箱不能为空", groups = { AddGroup.class,
			UpdateGroup.class })
	@Email(message = "邮箱格式不正确", groups = { AddGroup.class, UpdateGroup.class })
	private String email;

	/**
	 * 手机号
	 */
	private String mobile;

	/**
	 * 状态 0：禁用 1：正常
	 */
	private Integer status;

	/**
	 * 角色ID列表
	 */
	private List<Long> roleIdList;

	/**
	 * 创建者ID
	 */
	private Long createUserId;

	/**
	 * 创建时间
	 */
	private Date createTime;

}
